﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Demo.Framework.Strings.DuplicateChar
{
    class Program
    {
        static void Main(string[] args)
        {
            // unique element in the middle
            //List<char> chars = new List<char>()
            //{
            //    'a','a','b','c','d','@','a','d', 'A'
            //};

            // unique element @ start
            //List<char> chars = new List<char>()
            //{
            //    'B','b','a','c','d','@','b','d'
            //};

            // unique element @ end
            List<char> chars = new List<char>()
            {
                'a','C','@','D','@','a', '@','a','D', 'C','c'
            };

            // No unique element
            //List<char> chars = new List<char>()
            //{
            //    'a','@','d','a','a','a','A','X','d','@', 'A', 'X'
            //};

            // null entry
            //List<char> chars = null;           
            
            // one entry
            //List<char> chars = new List<char>()
            //{
            //    'a', 'a','a','a'
            //};

            try
            {
                StreamManager sm = new StreamManager(chars);
                Console.WriteLine("The first unique character : {0}", sm.GetFirstUnique());
            }
            catch (Exception ex)
            {                
                Console.WriteLine(ex.Message);
            }

            Console.Read();
        }
    }
}
